<div style="padding-top: 60px;">
    <div id="reg" style="padding-top: 60px">
        <div class="regPanel" id="userInfo">
            <script type="text/x-dot-template" id="userInfoTemp">
                <ul>
                    <li class="backColor">
                        <span>真实姓名</span>
                        <input type="text" value="{{=it.userName}}" id="realName" name="realName" disabled>
                        <input type="hidden" value="{{=it.userId}}" id="userId" name="userId">
                    </li>
                    <li class="backColor">
                        <span>手机号码</span>
                        <input type="text" value="{{=it.cellPhone}}" id="mobile" name="mobile" disabled>
                    </li>
                    <li class="backColor">
                        <span>座机号码</span>
                        <input type="text" value="{{=it.deskPhone}}" id="phone" name="phone" placeholder="请输入座机号码">
                    </li>
                    <li class="backColor">
                        <span>房间号</span>
                        <input type="text" value="{{=it.room}}" id="roomNum" name="roomNum" placeholder="请输房间号">
                    </li>
                    <li>
                        <div id="saveButton"
                             style="background-size: 100% 100%;font-size:18px;font-weight:800;color:white;background-image: url('/statics/imgs/extendGroupRegButton.png?v=${params.ver}');width: 100%;height: 45px;">
                            保存
                        </div>
                    </li>
                </ul>
            </script>
        </div>
    </div>
</div>


<div class="ypfood-head">
    <div class="back-div" onClick="javascript :history.back(-1);"><img
            src="/statics/imgs/head-back.png?v=${params.ver}"></div>
    <div>
        <span class="title-span">个人信息</span>
    </div>
</div>
<a id='call' href="tel:01058106587" style="display: none;">拨号</a>
<script>
    json("/user/userInfo.jspa", {userId: "${userSession.userId}"}, function (data) {
        $("#userInfo").html(doT.template($("#userInfoTemp").html())(data));
        $("#saveButton").bind("click", function () {
            if ($("#registButton").val() == "保存用户信息...") {
                return;
            }
            $("#registButton").val("保存用户信息...");
            json("/user/saveUserInfo.jspa", {
                userId: $("#userId").val(),
                phone: $("#phone").val(),
                roomNum: $("#roomNum").val()
            }, function (data) {
                if (data.code == 0) {
                    window.location.href = document.referrer;
                } else {
                    $("#registButton").val("保存");
                }
            });
        });
    });

</script>